# -*- coding: utf-8 -*-

###########################################################################
## Python code generated with wxFormBuilder (version Feb 16 2016)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc
from save import Save
from check import Check
from scrap import Scrap

from save_frame import SaveFrame
from search import SearchFrame
from scrap_frame import ScrapFrame
from newInfo import newFrame
from find import FindFrame
import main_frame

from wx.lib.embeddedimage import PyEmbeddedImage
import image

###########################################################################
## Class MainFrame
###########################################################################
G_soft_ver="V0.321"


class MainFrame(main_frame.MainFrame):
    def __init__( self, parent ):
        main_frame.MainFrame.__init__ ( self, parent )
        self.SetBackgroundColour('write')
        self.m_staticText12.SetLabel(G_soft_ver)
    # Virtual event handlers, overide them in your derived class
    def on_btnNew_Mate(self, event):
        app1 = wx.App()
        window1 = newFrame(None)
        window1.Show(True)
        app1.MainLoop()

    def on_btnFind_Mate(self, event):
        app = wx.App(False) 
        frame = FindFrame(None) 
        frame.Show(True) 
        app.MainLoop()


    def on_btnSave_Mate(self, event):
        app = wx.App()
        window = BackFrame(None)
        window.Show(True)
        app.MainLoop()

    def on_btnDel_Mate(self, event):
        app = wx.App()
        window = ScrapFrame(None)
        window.Show(True)
        app.MainLoop()

    def on_btnSearch_Mate(self, event):
        app = wx.App()
        window = SearchFrame(None)
        window.Show(True)
        app.MainLoop()

    def on_btnExit_Mate(self,event):
        ret = wx.MessageBox('确定关闭',  'Confirm', wx.OK|wx.CANCEL)
        if ret == wx.OK:
            wx.Exit()
            exit()

    def OnClose(self, event):
        wx.Exit()
        exit()
        #ret = wx.MessageBox('确定关闭',  'Confirm', wx.OK|wx.CANCEL)
       # if ret == wx.OK:
            # do something here...
            #OnExit()
            #wx.Exit()
            #exit()
app=wx.App()
window=MainFrame(None)
window.Show(True)
app.MainLoop()